import 'package:flutter/material.dart';
import 'package:flutter_widget/src/config/color_define.dart';

//滚动到边缘效果
class CusBehavior extends ScrollBehavior {
  final bool showTrailing;
  final bool showLeading;
  final bool isAndroidStyle;

  const CusBehavior({
    this.showTrailing = true,
    this.isAndroidStyle = false,
    this.showLeading = false,
  }) : super();

  @override
  Widget buildViewportChrome(
      BuildContext context, Widget child, AxisDirection axisDirection) {
    return GlowingOverscrollIndicator(
      axisDirection: axisDirection,
      color: FWColorPicker.colorFFA98A62,
      showLeading: showLeading,
      showTrailing: showTrailing,
      child: child,
    );
  }

  @override
  ScrollPhysics getScrollPhysics(BuildContext context) {
    return const ClampingScrollPhysics();
  }
}